import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import Memberinfo from '@/components/Memberinfo'
import Usercont from '@/components/Usercont'
import Message from '@/components/Message'
import News from '@/components/News'
import Newscont from '@/components/Newscont'
import Member from '@/components/Member'
import Memberkt from '@/components/Memberkt'
import About from '@/components/About'
import Smrz from '@/components/Smrz'
import Logins from '@/components/Logins'
import Huodong from '@/components/Huodong'
import Keyword from '@/components/Keyword'
import Wechat from '@/components/Wechat'
import Ranking from '@/components/Ranking'
import Share from '@/components/Share'
import Shares from '@/components/Shares'
import Meta from 'vue-meta' 
//

Vue.use(Meta)
Vue.use(Router)

const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}


export default new Router({
  // mode: 'history',  //去掉url中的#
  routes: [
    {
      path: '/',
      component: Index,
      meta: {
        title: '首页 ',
        keepAlive: true,
      },
    },
    {
      path: '/Wechat',
      component: Wechat,
      meta: {
        title: '微信登录',
      }
    },
    {
      path: '/Share',
      component: Share,
      meta: {
        title: '个人分享',
      }
    },
    {
      path: '/Shares',
      component: Shares,
      meta: {
        title: '分享',
      }
    },
    {
      path: '/Memberinfo',
      component: Memberinfo,
      meta: {
        title: '完善信息',
        // type:'login'
      }
    },
    {
      path: '/Usercont',
      component: Usercont,
      meta: {
        title: '信息详情',
      }
    },
    {
      path: '/Message',
      component: Message,
      meta: {
        title: '消息',
        keepAlive: true,
      }
    },
    {
      path: '/News',
      component: News,
      meta: {
        title: '新闻',
        keepAlive: true,
      }
    },
    {
      path: '/Ranking',
      component: Ranking,
      meta: {
        title: '排行榜',
      }
    },
    {
      path: '/Newscont',
      component: Newscont,
      meta: {
        title: '新闻详情',
      }
    },
    {
      path: '/Member',
      component: Member,
      meta: {
        title: '我的',
      }
    },
    {
      path: '/Memberkt',
      component: Memberkt,
      meta: {
        title: '开通会员',
      }
    },
    {
      path: '/Huodong',
      component: Huodong,
      meta: {
        title: '活动详情',
      }
    },
    {
      path: '/About',
      component: About,
      meta: {
        title: '内容',
      }
    },


    {
      path: '/Smrz',
      component: Smrz,
      meta: {
        title: '实名认证',
      }
    },
    {
      path: '/Keyword',
      component: Keyword,
      meta: {
        title: '搜索',
        keepAlive: true,
      }
    },
    {
      path: '/Logins',
      component: Logins,
      meta: {
        title: '登录',
        keepAlive: true,
      }
    },
    {
      path: '/download',
      component: () => import('@/components/download.vue'),
      meta: {
        title: 'APP下载',
        keepAlive: false,
      }
    },
  ]
})
